export const glasses: GameEntity =
    world.querySelector('#钢化玻璃（长方形）-1')!;
world.useOBB = true;

const glassZone: GameZone = world.addZone({
    bounds: new GameBounds3(
        new GameVector3(180, 17, 105),
        new GameVector3(190, 30, 114)
    ),
    selector: 'player',
});

glassZone.onEnter(({ entity }) => {
    entity.player!.enableDoubleJump = false;
    entity.player!.runSpeed = 0.22;
    const { point } = entity;
    const interval = setInterval(() => {
        if (point !== entity.point) {
            entity.player!.enableDoubleJump = true;
            entity.player!.runSpeed = 0.4;
            clearInterval(interval);
            return;
        }
    }, 1000);
});

// glassZone.onLeave(({ entity }) => {
//     entity.player!.enableDoubleJump = true
//     entity.player!.runSpeed = 0.4
// })
